package com.cloud.order.converter;

import com.cloud.order.client.ProductClient;
import com.cloud.order.entity.ProductInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
public class ServerController {
    @Autowired
    private ProductClient productClient;

    @GetMapping("/msg")
    public String msg() {
        return "this is product msg";
    }

    @GetMapping("/test")
    public List<ProductInfo> test() {
        List<ProductInfo> productInfos = productClient.listForOrder(Arrays.asList("157875196366160022", "157875227953464068"));
        return productInfos;
    }
}
